package com.util;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;


public class ObjectSerialer {
     public static  String toXML(Object obj) throws Exception{
        XStream xs = new XStream(new DomDriver());
        String xml=xs.toXML(obj);
        return xml;

    }
    public static  Object toObj(String json)  throws Exception{
        XStream xs = new XStream(new DomDriver());
		return xs.fromXML(json);
    }
}
